Added allowance for argument zero_terms_query to be any case. Allowed…#95
Conversation
| while (iterator.hasNext()) { | ||
| NamedArgumentExpression arg = (NamedArgumentExpression) iterator.next(); | ||
| if (!queryBuildActions.containsKey(arg.getArgName())) { | ||
| String argNormalized = arg.getArgName().toLowerCase(); |
There was a problem hiding this comment.
The isLowerCase may fail if arg.getArgName() doesn't exist.
...st/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchPhraseQueryTest.java
Show resolved
Hide resolved
...st/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchPhraseQueryTest.java
Show resolved
Hide resolved
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
SQL/PPL parser is already case-insensitive. The goal is to change case for some parameter values.
See example from main:
opensearchsql> select * from logs where simple_query_string(['*'], 'CLR', AnAlYZer = 'standard');
Output longer than terminal width
Do you want to display data vertically for better visual effect? [y/N]: y
opensearchsql> select * from logs where simple_query_string(['*'], 'CLR', analyzer = 'stAndaRd');
TransportError(500, 'SearchPhaseExecutionException', {'error': {'type': 'SearchPhaseExecutionException', 'reason': 'Error occurred in OpenSearch engine: all shards failed', 'details': 'Shard[0]: [logs/uHvAufvyREut9LnosEX2yg] QueryShardException[[simple_query_string] analyzer [stAndaRd] not found]\n\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.'}, 'status': 503})
So all calls for analyzer's value should be wrapped by .toLower():
.put("analyzer", (b, v) -> b.analyzer(v.stringValue()))like you did for ZeroTermsQuery and Flags. Boost has double type, nothing to convert there, but what about Operator, DefaultOperator and so on?
...a/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MatchPhraseQuery.java
Outdated
Show resolved
Hide resolved
|
@MitchellGale-BitQuill the conflicts need to be resolved and SQL Java CI should pass as well. |
… is surrounded by same type of quote (opensearch-project#696) Signed-off-by: mitchellg <mitchellg@bitquilltech.com> Co-authored-by: Andrew Carbonetto <andrewc@AndrewsMBP2022.local>
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
… outside of main OS sql project (opensearch-project#704) Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
* Add support for highlight to parser and AstExpressionBuilder
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Add unit test for highlight in AstExpressionBuilder
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Add unit test for highlight in AstBuilderTest
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Support highlight as an Unresolved expression.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Represent highlight as UnresolvedExpression.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Support highlight in Analyzer.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Treat highlight as a proper function in AST
In particular, highlightField is an expression now.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Add support for highlight in Analyzer
HighlightFunction is converted to LogicalHighlight logical plan.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Add a simple IT test for highlight.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Register highlight function in the BuiltInFunctionRepository
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Partial support for highlight in physical plan.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Add HighlightOperator.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Highlight alpha complete.
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
* Initial implementation to upporting highlight('*')
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Add support for multiple highlight calls in select statement.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Removed OpenSearchLogicalIndexScan highlightFields and dependencies. Improved test coverage and fixing checkstyle errors.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Added HighlightExpressionTest
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Added javadocs, minor PR revisions, and fixed jacoco errors by improving coverage for OpenSearchIndexScan
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Code cleanup, adding parsing failure tests, and adding tests for highlight acceptance as a string literal as well as qualified name.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Removing HighlightOperator functionality and unnecessary visitHighlight call in PhysicalPlanNodeVisitor..
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Adding highlight function to functions.rst and removing unecessary function call in OpenSearchIndexScan.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Change highlight fields returned format to array list. Changed highlight all and wildcard to unsupported to open up output formatting changes for multiple returned highlight fields. Change tests for updated coverage and disable highlight all and wildcard tests.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Fix bug where invalid schema name was being used for returned highlight fields
Signed-off-by: forestmvey <forestv@bitquilltech.com>
* Fix failing integration tests due to schema changes for highlight expression type.
Signed-off-by: forestmvey <forestv@bitquilltech.com>
Co-authored-by: MaxKsyunz <maxk@bitquilltech.com>
534aa05 to
145b0c5
Compare
Codecov Report
@@ Coverage Diff @@
## Integ-RelFunc_changeCaseWhereAppropriate #95 +/- ##
==============================================================================
+ Coverage 97.74% 97.77% +0.02%
- Complexity 2858 2882 +24
==============================================================================
Files 273 276 +3
Lines 7020 7086 +66
Branches 442 447 +5
==============================================================================
+ Hits 6862 6928 +66
Misses 157 157
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
… is surrounded by same type of quote (opensearch-project#696) Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
…ed functions Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
145b0c5 to
6b2802a
Compare
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
…ed functions Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
Signed-off-by: mitchellg <mitchellg@bitquilltech.com>
…ub.com/Bit-Quill/opensearch-project-sql into dev-RelFunc_changeCaseWhereAppropriate
|
#103 PR remade in 103 |
Signed-off-by: Mitchell Gale mitchellg@bitquilltech.com
Description
Allows for any case on argument name for relevancy based function (Match Phrase Prefix, Simple Query String, Match Bool Prefix, Match, Multi-Match, Query String, Relevance, Simple Query String).
e.g.
AnalyZercan work instead of justanalyzerZero_Terms_Querycan work instead of justzero_terms_queryBOOstcan work instead of justboostAllows for
zero_term_queryarguments to be of any case.e.g.
Allcan work instead ofallCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.